/*
 * 舆情监测相关常量
 *
 * @Author:    1024创新实验室-主任：卓大
 * @Date:      2025-01-15 10:00:00
 * @Wechat:    zhuda1024
 * @Email:     lab1024@163.com
 * @Copyright  1024创新实验室 （ https://1024lab.net ），Since 2012
 */

/**
 * 情感倾向枚举
 */
export const SENTIMENT_ENUM = {
  POSITIVE: {
    value: 'POSITIVE',
    desc: '正面',
    color: '#52c41a'
  },
  NEGATIVE: {
    value: 'NEGATIVE', 
    desc: '负面',
    color: '#ff4d4f'
  },
  NEUTRAL: {
    value: 'NEUTRAL',
    desc: '中性',
    color: '#1890ff'
  }
};

/**
 * 搜索范围选项
 */
export const SEARCH_SCOPE_OPTIONS = [
  {
    label: '标题',
    value: 'title'
  },
  {
    label: '正文',
    value: 'content'
  },
  {
    label: '作者',
    value: 'author'
  }
];

/**
 * 情感倾向选项
 */
export const SENTIMENT_OPTIONS = [
  {
    label: '全部',
    value: ''
  },
  {
    label: SENTIMENT_ENUM.POSITIVE.desc,
    value: SENTIMENT_ENUM.POSITIVE.value
  },
  {
    label: SENTIMENT_ENUM.NEGATIVE.desc,
    value: SENTIMENT_ENUM.NEGATIVE.value
  },
  {
    label: SENTIMENT_ENUM.NEUTRAL.desc,
    value: SENTIMENT_ENUM.NEUTRAL.value
  }
];

/**
 * 根据情感倾向值获取描述和颜色
 */
export function getSentimentInfo(sentiment) {
  switch (sentiment) {
    case SENTIMENT_ENUM.POSITIVE.value:
      return SENTIMENT_ENUM.POSITIVE;
    case SENTIMENT_ENUM.NEGATIVE.value:
      return SENTIMENT_ENUM.NEGATIVE;
    case SENTIMENT_ENUM.NEUTRAL.value:
      return SENTIMENT_ENUM.NEUTRAL;
    default:
      return SENTIMENT_ENUM.NEUTRAL;
  }
} 